package com.cobra.rdd.operator.transform

import org.apache.spark.{SparkConf, SparkContext}

//分区不变原理
object Spark13_RDD_Operator_Transform_GROUP_Filter_Test {
  def main(args: Array[String]): Unit = {
    val sparkConf = new SparkConf().setMaster("local[*]").setAppName("Spark13_RDD_Operator_Transform_GROUP_Filter_Test")
    val sc = new SparkContext(sparkConf)
    //算子获取
    val rdd = sc.textFile("datas/apache.log")
    val filterRDD = rdd.filter(
      line => {
        val datas = line.split(" ")
        val time = datas(3)
        time.startsWith("17/05/2015")
      }
    )
    filterRDD.collect().foreach(println)
    sc.stop()
  }
}
